package com.intre.open.gwtjpa.data.second.domain;


import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Index;
import org.hibernate.search.annotations.Indexed;
import org.hibernate.search.annotations.Store;

import net.sf.gilead.pojo.gwt.LightEntity;


@Entity
@Indexed
@Table(name = "city", schema = "public")
public class City extends LightEntity implements Serializable {

	private static final long serialVersionUID = 7944669808422461413L;

	private long id;
	private String name;
	private String state;

	
	@DocumentId
	@Column(name = "id", unique = true, nullable = false)
	@Id
    @GeneratedValue(generator="city_id_seq")
    @SequenceGenerator(name="city_id_seq", sequenceName="public.city_id_seq")
	public long getId() {
		return id;
	}
	
	public void setId(long id) {
		this.id = id;
	}

	@Column(name = "name")
	@Field(index = Index.TOKENIZED, store = Store.YES)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "state")
	@Field(index = Index.TOKENIZED, store = Store.YES)
	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

	
}
